﻿//
//  mysql.hpp
//  TcpServer
//
//  Created by sandrial on 2017/9/20.
//  Copyright © 2017年 wzy. All rights reserved.
//

#ifndef mysql_hpp
#define mysql_hpp

#include <mysql.h>
#include <string>

class MysqlDb{
private:
    const char* user;
    const char* pswd;
    const char* host;
    const char* database;
    unsigned int port;
    MYSQL db;
    MYSQL_RES *result;
    MYSQL_ROW sql_row;
    int res;
    
    enum sqlMode{
        ins,
        del,
        sel,
        upd
    };
public:
    MysqlDb();
    int conndb();
    int disconndb();
    
    
    //自定义
    int dbLogin(std::string &usr, std::string &passwd);
};
#endif /* mysql_hpp */
